import Vue from 'vue'
import App from './App'
import request from "./api/http.api.js";

Vue.config.productionTip = false
Vue.prototype.$http = request;

App.mpType = 'app'

// 引入全局uView
import uView from 'uview-ui'
Vue.use(uView);

const app = new Vue({
	...App
})

Vue.prototype.checkLogin = function() {
	const userId = uni.getStorageSync("userId");
	if (userId === '') { // 本地没有token表示未登录
		//console.log('未登录返回到登录页')
		uni.reLaunch({
			url: '/pages/login/login'
		})
		return false
	}
}

app.$mount()
